﻿@{
    ViewBag.Title = "ButtionsEdit";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@model YJ.Data.Model.AppLibraryButtons
<form method="post">
    @Html.AntiForgeryToken()
    <br />
    <table cellpadding="0" cellspacing="1" border="0" width="99%" class="formtable">
    <tr>
        <th style="width: 80px;">名称：</th>
        <td><input type="text" name="Name" id="Name" class="mytext" value="@Model.Name" validate="empty" style="width: 75%"/></td>
    </tr>
    <tr>
        <th>执行脚本：</th>
        <td><textarea class="mytext" name="Events" id="Events" cols="1" rows="1" validate="empty" style="width: 75%; height: 80px;">@Model.Events</textarea></td>
    </tr>
    <tr>
        <th style="width: 80px;">图标：</th>
        <td><input type="text" name="Ico" id="Ico" class="myico" source="/Images/ico" value="@Model.Ico" style="width: 69%"/></td>
    </tr>
    <tr>
        <th>备注说明：</th>
        <td><textarea class="mytext" name="Note" cols="1" rows="1" style="width: 95%; height: 50px;">@Model.Note</textarea></td>
    </tr>
    <tr>
        <th style="width: 80px;">排序：</th>
        <td><input type="text" name="Sort" id="Sort" class="mytext" value="@Model.Sort" validate="empty"/></td>
    </tr>
    </table>
    <div class="buttondiv">
        <input type="button" value="确定保存" class="mybutton" onclick="checkform(this);"/>
        <input type="button" class="mybutton" value="取消关闭" style="margin-left: 5px;" onclick="new RoadUI.Window().close();" />
    </div>
</form>
<script type="text/javascript">
    $(function ()
    {
        @Html.Raw(ViewBag.Script)
    });
    function checkform(but)
    {
        var f = document.forms[0];
        var flag = new RoadUI.Validate().validateForm(f);
        $(but).prop('disabled', flag);
        if (flag)
        {
            f.submit();
        }
    }
</script>
